<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>板卡管理</title>
<meta name="decorator" content="default" />
<tags:import includes="spinner,bootbox"></tags:import>
<script src="${ctxStatic}/modules/cfg/cfg.js"></script>
<script src="${ctxStatic}/modules/cfg/card.js"></script>
<script>
	//上下文地址
	var CONTEXT_URL = "/cfg/card/";
	var pageType = 'card';
	function page(n, s) {
		$("#pageNo").val(n);
		$("#pageSize").val(s);
		$("#frmSearch").submit();
		return false;
	}
</script>
</head>
<body>
	<br>
	<form id="frmSearch" modelAttribute="item" action="${ctx}/cfg/card/"
		method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${pages.pageNo}" />
		<input id="pageSize" name="pageSize" type="hidden"
			value="${pages.pageSize}" /> &nbsp;&nbsp; <label>名称 ：</label><input
			type="text" name="cardname" htmlEscape="false" maxlength="50"
			class="input-medium" /> &nbsp;<input id="btnQuery"
			class="btn btn-success" " type="submit" value="查询" /> &nbsp;<input
			id="btnNew" class="btn" type="button" value="新增" /> &nbsp;<input
			id="btnDelete" class="btn" type="button" value="删除" />
	</form>
	<br>
	<br>
	<table id="contentTable"
		class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th class="center" style="width: 50px;"><label> <input
						type="checkbox" class="ace" /> <span class="lbl"></span>
				</label></th>
				<th>名称</th>
				<th>类型</th>
				<th>备注</th>
				<th>编辑</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${pages.list}" var="item">
				<tr>
					<td class="center"><label> <input
							value="${item.cardid}" type="checkbox" class="ace" /> <span
							class="lbl"></span>
					</label></td>
					<td>${item.cardname}</td>
					<td>${fns:getDictLabel(item.type,'mgr_card_type','N/A')}</td>
					<td>${item.comment}</td>
					<td><a href="javascript:onDelete('${item.cardid}')">删除</a> <a
						href="javascript:onUpdate('${item.cardid}')">编辑</a></td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	${pages}
	<!-- 模态窗体 -->
	<div id="modalTable" action="new" class="modal fade" tabindex="-1"
		style="display: none; width: 402px; height: 336px;">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header no-padding">
					<div class="table-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-hidden="true">
							<span class="white">&times;</span>
						</button>
						<span id='modalTitle'>新增窗体</span>
					</div>
				</div>
				<br>
				<!-- 新增窗体内部 -->
				<form id="frmSubmit" class="form-horizontal" role="form"
					method="post">
					<input type="hidden" name="cardid" uname="update" />		
					<div class="form-group">
						<label class="col-sm-3 control-label no-padding-right">板卡名称</label>
						<div class="col-sm-9">
							<input type="text" class="col-xs-10" name="cardname"
								uname="update" />
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label no-padding-right">类型</label>
						<div class="col-sm-9">
							<widgets:select datasource="${fns:getDictList('mgr_card_type')}"
								width="130" uname="update" dictName="type"
								dataPlaceholder="字典类型">
							</widgets:select>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label no-padding-right">备注</label>
						<div class="col-sm-9">
							<input type="text" class="col-xs-10" name="comment"
								uname="update" />
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label no-padding-right">启用</label>
						<div class="col-sm-9">
							<widgets:select datasource="${fns:getDictList('yes_no')}"
								width="130" 
								uname="update" 
								dictName="isEnable"
								dataPlaceholder="字典类型">
							</widgets:select>
						</div>
					</div>
					<div class="space-4"></div>
					<div class="clearfix form-actions">
						<div class="center">
							<button id="btnSubmit" class="btn btn-info" type="button">
								<i class="icon-ok bigger-110"></i> 保存
							</button>
							&nbsp; &nbsp; &nbsp;
							<button class="btn" type="reset">
								<i class="icon-undo bigger-110"></i> 重置
							</button>
						</div>
					</div>
				</form>
				<!-- PAGE CONTENT ENDS -->
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal-dialog -->
	</div>
</body>
</html>